package com.xuanwu.mall.goods.controller;

import com.xuanwu.mall.goods.entity.PmsCategory;
import com.xuanwu.mall.goods.service.IPmsCategoryService;
import com.xuanwu.mall.util.common.RespResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * xuanwu-mall
 * com.xuanwu.mall.goods.controller
 *
 * @Description:
 * @Author：xuanwudeshuijngye_26567
 * @Date 2024-03-19 19:07
 * @Company: 旋舞科技有限公司
 **/
@RestController
@RequestMapping("/pmsCategory")
public class PmsCategoryController {

    @Autowired
    private IPmsCategoryService iPmsCategoryService;

    @GetMapping("/findByParentId/{parentId}")
     public RespResult findByParentId(@PathVariable Long parentId){
        List<PmsCategory> categoryList = iPmsCategoryService.findByParentId(parentId);
       return RespResult.successResult(categoryList);
     }


}
